home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / xmsif15.zip / XMSIF.H < prev    next >
C/C++ Source or Header  |  1993-04-22  |  4KB  |  157 lines

  1. /***************************************************************************
  2. *   XMSIF.H                                                                *
  3. *   HEADER FOR XMSIF                                                       *
  4. *   OS:        DOS                                                         *
  5. *   VERSION:   1.5                                                         *
  6. *   DATE:      04/22/93                                                    *
  7. *                                                                          *
  8. *   Copyright (c) 1993 James W. Birdsall. All Rights Reserved.             *
  9. *                                                                          *
  10. ***************************************************************************/
  11.  
  12. #ifndef XMSIF_H
  13. #define XMSIF_H
  14.  
  15. /*
  16. ** system includes <>
  17. */
  18.  
  19. /*
  20. ** custom includes ""
  21. */
  22.  
  23. /*
  24. ** local #defines
  25. */
  26.  
  27. /* error returns */
  28.  
  29. #define XMMOOPS     -1
  30. #define NOXMM       -2
  31.  
  32.  
  33. /* XMM library errors */
  34.  
  35. #define XMM_NOINIT          0x40
  36. #define XMM_UMBHUGE         0x41
  37. #define XMM_BADPTR          0x42
  38. #define XMM_ELTOOBIG        0x43
  39. #define XMM_SKTOOBIG        0x44
  40. #define XMM_BADVERS         0x45
  41.  
  42.  
  43. /* XMS driver errors */
  44.  
  45. #define XMM_UNIMP           0x80
  46. #define XMM_VDISK           0x81
  47. #define XMM_A20ERROR        0x82
  48. #define XMM_GENERROR        0x8E
  49. #define XMM_UNRECERROR      0x8F
  50.  
  51. #define XMM_NOHMA           0x90
  52. #define XMM_HMAUSED         0x91
  53. #define XMM_HMATOOBIG       0x92
  54. #define XMM_HMANOALLOC      0x93
  55. #define XMM_A20STILLEN      0x94
  56.  
  57. #define XMM_NOFREEX         0xA0
  58. #define XMM_NOFREEXHAN      0xA1
  59. #define XMM_BADXHAN         0xA2
  60. #define XMM_BADSRCHAN       0xA3
  61. #define XMM_BADSRCOFF       0xA4
  62. #define XMM_BADDESTHAN      0xA5
  63. #define XMM_BADDESTOFF      0xA6
  64. #define XMM_BADLENGTH       0xA7
  65. #define XMM_COPYOVERLAP     0xA8
  66. #define XMM_PARITY          0xA9
  67. #define XMM_NOLOCK          0xAA
  68. #define XMM_LOCKED          0xAB
  69. #define XMM_TOOMANYLOCKS    0xAC
  70. #define XMM_LOCKFAIL        0xAD
  71.  
  72. #define XMM_UMBSMALLER      0xB0
  73. #define XMM_NOFREEUMB       0xB1
  74. #define XMM_BADUMBHAN       0xB2
  75.  
  76.  
  77. /* function macros */
  78.  
  79. #define XMMcopyto(clen,src,dhan,doff)    _XMMcopy((clen),0, \
  80.                                             (unsigned long)(src),(dhan),(doff))
  81. #define XMMcopyfrom(clen,shan,soff,dest) _XMMcopy((clen),(shan),(soff),0, \
  82.                                                          (unsigned long)(dest))
  83.  
  84. #define XMMicopyto(n,e,b,s,h,f)          _XMMicopy((n),(e),(b),0, \
  85.                                                 (unsigned long)(s),(h),(f),(b))
  86. #define XMMicopyfrom(n,e,b,h,f,d)        _XMMicopy((n),(e),(b),(h),(f),0, \
  87.                                                         (unsigned long)(d),(b))
  88.  
  89.  
  90. /*
  91. ** misc: copyright strings, version macros, etc.
  92. */
  93.  
  94. /*
  95. ** typedefs
  96. */
  97.  
  98. struct XMMregs {
  99.     unsigned int regAX;
  100.     unsigned int regBX;
  101.     unsigned int regDX;
  102.     unsigned int regSI;
  103.     unsigned int regDS;
  104. };
  105.  
  106. struct XMMbigregs {
  107.     unsigned long regEAX;
  108.     unsigned long regEBX;
  109.     unsigned long regECX;
  110.     unsigned long regEDX;
  111. };
  112.  
  113.  
  114. /*
  115. ** global variables
  116. */
  117.  
  118. extern unsigned char const _XMMerror;         /* XMS error variable */
  119. extern unsigned int  const _XMMversion;       /* XMS version, BCD */
  120.  
  121. extern char const xmsif_vers_vers[];
  122. extern char const xmsif_vers_date[];
  123. extern char const xmsif_vers_time[];
  124.  
  125.  
  126. /*
  127. ** function prototypes
  128. */
  129.  
  130. extern int XMMlibinit(void);
  131. extern unsigned int XMMgetversion(void);
  132.  
  133. extern unsigned long XMMcoreleft(void);
  134. extern unsigned long XMMallcoreleft(void);
  135.  
  136. extern int XMMalloc(unsigned long bytes);
  137. extern int XMMrealloc(int handle, unsigned long bytes);
  138. extern int XMMfree(int handle);
  139.  
  140. extern int _XMMcopy(unsigned long clen,
  141.                     int shan, unsigned long soff,
  142.                     int dhan, unsigned long doff);
  143. extern int _XMMicopy(unsigned long nelem, int elsize,
  144.                      unsigned int sskip, int shan, unsigned long soff,
  145.                      int dhan, unsigned long doff, unsigned int dskip);
  146.  
  147. extern int XMMrawcall(struct XMMregs *regs);
  148. extern void XMMraw3(struct XMMbigregs *regs);
  149.  
  150. extern unsigned long UMBcoreleft(void);
  151. extern unsigned long UMBallcoreleft(void);
  152.  
  153. extern void far *UMBalloc(unsigned long bytes, unsigned long *finalsize);
  154. extern int UMBfree(void far *handle);
  155.  
  156. #endif
  157.